#ifndef __ALBUM_VIDEO_H__
#define __ALBUM_VIDEO_H__

#include "sqlite3.h"
#include "common_info.h"

#include <ctime>
#include <vector>
#include <string>

// typedef struct {
//     std::string file_path;
//     std::time_t modification_time;
//     std::string thumbnail_path;
//     std::string file_size;
//     int duration;
//     int width;
//     int height;
// } VideoInfo;

class AlbumVideo {
public:
    AlbumVideo();
    ~AlbumVideo();

    int getVideoInfo(const std::string& file_path, VideoInfo& video_info);
    void getFrameFromvideo(const std::string& video_file, const std::string& output_image_file);
    int createVideoInfoTable(sqlite3* db);
    int insertVideoInfo(const VideoInfo& video_info);
    std::vector<VideoInfo> queryVideoInfoByTime();
    std::vector<VideoInfo> queryAllVideoInfo();
    std::vector<VideoInfo> queryVideoInfoByFilepath(const std::string& file_path);
    bool updateVideoInfo(const std::string& file_path, const std::string& new_filename);
    bool deleteVideoInfo(const std::string& file_path);
    void printVideoInfo(const VideoInfo& video_info);
    int getCount();
    std::vector<VideoInfo> queryVideoInfoByTime(int page_index, int page_size);
    bool deleteVideo(const std::string& file_path);
    bool renameVideo(const std::string& file_path, const std::string& new_filename);
    bool updateVideo(const std::string& file_path);
};


#endif
